package com.redissession.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class sessionController {
	@Value("${server.port}")
	private String port;
	@GetMapping("/session")
	public Map<String,Object> getSession(HttpServletRequest request){
		Map<String ,Object>map=new HashMap<>();
		map.put("sessionId", request.getSession().getId());
		map.put("port", port);
		return map;
	}
}
